#!/usr/bin/python


def safe_save(dct, key, val):
    if key not in dct.keys():
        dct[key] = val
    else:
        mod_id = 1
        key_mod = '{} {}'.format(key, mod_id)
        while key_mod in dct.keys():
            mod_id += 1
            key_mod = '{} {}'.format(key, mod_id)
        dct[key_mod] = val
